package cn.com.jtang.wedding.interceptor;

import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class ChannelLoginInterceptor extends AbstractInterceptor{
	
	@Override
	public String intercept(ActionInvocation actionInvocation) throws Exception {

        String name = actionInvocation.getInvocationContext().getName();
        if (name.equals("login")||name.equals("doChannelLogin")) {
            return actionInvocation.invoke();
        }
        Map session = actionInvocation.getInvocationContext().getSession();
        Object object = session.get("currentadminuser");
        if(object==null){
        	return "nologin";
        }
        return actionInvocation.invoke();
	}

}
